package cn.sundat.utils;

import java.util.List;

import javax.annotation.Resource;
import javax.mail.MessagingException;
import javax.mail.internet.AddressException;

import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import cn.sundat.model.Company;
import cn.sundat.model.Profile;
import cn.sundat.service.CompanyService;
import cn.sundat.service.ProfileService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class Test{
	@Resource(name="companyService")
	private CompanyService companyService;
	
	@Resource(name="profileService")
	private ProfileService profileService;
	
//	public static void main(String[] args) throws Exception {
////		MailUtil.sendMail("1919597949@qq.com","您的邮件已经确认激活!");
////		MailUtils.sendMail("1184277600@qq.com", "小伙子");
//		MailUtils.sendMail("jackma@xjeca.com", "测试邮件a");
//	}
	@org.junit.Test
	public void run2() {
		List<Company> listCompany = companyService.findCompanyByKey("comp_id", "19");
		for (Company company : listCompany) {
			System.out.println(company.getComp_name()+"  "+company.getProfile().getPro_email());
		}
	}
	@org.junit.Test
	public void qrcodeTest() {
		QrcodeUtil.createQrcode("D:/Desktop/homecode.png", "http://www.xje-ca.cn");
	}
	
	@org.junit.Test
	public void qrcodeTest2(){
		QrcodeUtil.createQrcode("D://mobile.png", "http://www.xje-ca.cn/xjeca/news_findByPageOnMbile?categoryId=13");
	}
}


